package com.jdf.exception;


import com.jdf.enums.GlobalExceptionCode;
import lombok.Data;

/**
 * @description:
 * @author: Bug修复机
 * @date: 2022年09月24日 ： 14:04
 * @version: ver1.0
 * @email tangli@itsource.cn
 */
@Data
public class GlobalCustomException extends RuntimeException{

    private String errorMessage;

    private String errorCode;

    public GlobalCustomException() {
    }

    public GlobalCustomException(String message) {
        super(message);
    }

    public GlobalCustomException(String errorMessage, String errorCode) {
        super(errorMessage);
        this.errorCode = errorCode;
        this.errorMessage = errorMessage;
    }

    public GlobalCustomException(GlobalExceptionCode globalExceptionCode) {
        super(globalExceptionCode.getMessage());
        this.errorCode = globalExceptionCode.getCode();
        this.errorMessage = globalExceptionCode.getMessage();
    }
}
